
object ScalaOne {

  def main(args: Array[String]): Unit = {

        val arr = Array(1,2,3)
        val list = List(1,2,3)
        val map = Map(1 -> "A" ,2 -> "B")
        for ( (k,v) <- map) {
          println(k + ":" + v)
        }

        val set = Set(1,2,3,3)
        for(i <- set){
          println( i)
        }

        val tuple = (1,"a",2.0)
        println(tuple._2)

         val a = 19
         val b =   if( a > 18 )  1
         println( b )

    def add(a:Int,b:Int):Int = {
      return a + b
    }

    // 匿名函数    函数名省略
    val func =    (a:Int,b:Int) =>  1

    println( func(1, 2) )


    // 伴生类，伴生对象











  }

}
